
import { Navigate } from "react-router-dom";
import Mylayout from '../layout/MyLayout'
import menus from "./child";
import Error from "../components/Error";
import Login from "../components/Login";
import Register from "../components/Register";
import Password from "../components/Password";
import Project from "../components/Project";
const routes =[
    {
        path:'/',
        element:<Navigate to='/home/assets/build'></Navigate>,
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:"/register",
        element:<Register></Register>
    },
    {
        path:'/password',
        element:<Password></Password>
    },
    {
        path:'/project',
        element:<Project></Project>
    },
    {
        path:'/home',
        element:<Mylayout></Mylayout>,
        children:[
            {
                path:'',
                index:true,
                element:<Navigate to='/home/assets/build'></Navigate>
            },
            ...menus]
    },
    {
        path:'*', //*通配符,表示匹配所有
        element:<Error></Error>
    }
]

export default routes;